import ApplicationContext from "./ApplicationContext.js"
import  Resource from "./decorator/Resource.js"
import Synchro from "./control/Synchro.js"
const inBrowser = typeof window !== 'undefined'

export default class QGuanRunApplication{

    constructor(parmList,resolve){
        // this.applicationContext =ApplicationContext.getInstance();
        console.log("启动 轻管")
        let context=  ApplicationContext.getInstance();
        context.saveBend('resource',Resource) ;
        context.saveBend('save',save) ;
        context.saveBend('synchro',Synchro) ;
        if(inBrowser){
            window.applicationContext=context
            window.qguan=find;
        }else {
            global.applicationContext =context
            global.qguan=find
        }

        applicationContext.inBrowser=inBrowser;

        console.log("启动成功")

    }

}
function save(a,b,c,d){
    applicationContext.saveBend(a,b,c,d);
}

function find(a,b,c,d){
    return applicationContext.find(a,b,c,d);
}
